//
//  TextViewCell.m
//  PropertyMananger
//
//  Created by Mansion on 17/1/21.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "TextViewCell.h"

@implementation TextViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *cellID = @"TextViewCellID";
    TextViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if(cell == nil) {
        cell = [[TextViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    //选中cell的颜色 -无色
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return cell;
    
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
    
        self.titleLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.titleLabel];
        self.titleLabel.textColor = BHColor(153, 153, 153);
        
        self.titleLabel.font = BHFont(15);
        self.titleLabel.textAlignment = NSTextAlignmentLeft;
        self.titleLabel.text = @"处理结果";
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(15);
            make.top.equalTo(self).with.offset(7.5);
            make.size.mas_equalTo(CGSizeMake(100, 25));
        }];

        
        self.textView = [[PlaceholderTextView alloc]init];
        [self.contentView addSubview:self.textView];
        self.textView.backgroundColor = [UIColor whiteColor];
        self.textView.delegate = self;
        self.textView.font = [UIFont systemFontOfSize:14.f];
        self.textView.textColor = [UIColor blackColor];
        self.textView.textAlignment = NSTextAlignmentLeft;
        self.textView.editable = YES;
        self.textView.layer.cornerRadius = 4.0f;
        self.textView.layer.borderColor = BHColor(102, 102, 102).CGColor;
        self.textView.layer.borderWidth = 0.1;
        self.textView.placeholderColor = BHColor(204, 204, 204);
        self.textView.placeholder = @"请输入处理结果!";
        
        
        [self.textView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(15);
            make.top.equalTo(self.titleLabel.mas_bottom).with.offset(5);
            make.size.mas_equalTo(CGSizeMake(BHscreenW - 30, 100));
        }];
        


    }
    return self;
}
@end
